package com.linkage.seapeak.activity.vote;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;

import com.linkage.jz.bankruptcy.R;
import com.linkage.seapeak.base.BaseWhiteActivity;

public class VoteTurnMoneyActivity extends BaseWhiteActivity {

    double money;
    private EditText editMoney;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vote_turn_money, "调整表决金额");
        money = getIntent().getDoubleExtra("money", 0d);
        initView();
    }

    private void initView() {
        editMoney = (EditText) findViewById(R.id.edit_money);
        editMoney.setText(money + "");
        addMenu(new MenuAction(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    money = Double.parseDouble(editMoney.getText().toString());
                } catch (Exception e) {
                    e.printStackTrace();
                    money = 0;
                }
                Intent intent = new Intent();
                intent.putExtra("money", money);
                setResult(RESULT_OK, intent);
                finish();
            }
        }, "完成", 0));
    }
}
